﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="LikesGraph.aspx.vb" Inherits="APhones2.LikesGraph" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .style1
        {
            font-size: x-large;
        }
    </style>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <strong>
    <span class="style1">GRAPH AND A TABLE SHOWING LIKES BY USERS</span></strong><br />

The Diagram above and the Table below shows Users like Phone

    <asp:Chart ID="Chart1" runat="server" DataSourceID="SqlDataSource1">
    <Series>
        <asp:Series Name="Series1" ChartType="Pie" XValueMember="PhoneName" 
            YValueMembers="CountOfID">
        </asp:Series>
    </Series>
    <ChartAreas>
        <asp:ChartArea Name="ChartArea1">
        </asp:ChartArea>
    </ChartAreas>
</asp:Chart>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:Phones %>" 
        ProviderName="<%$ ConnectionStrings:Phones.ProviderName %>" 
        SelectCommand="SELECT * FROM [CountLikes] WHERE ([CountOfID] &gt; ?) ORDER BY [CountOfID] DESC">
        <SelectParameters>
            <asp:Parameter DefaultValue="0" Name="CountOfID" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
    <br />
    <br />
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        DataSourceID="SqlDataSource2">
        <Columns>
            <asp:BoundField DataField="PhoneName" HeaderText="PhoneName" 
                SortExpression="PhoneName" />
            <asp:BoundField DataField="CountOfID" HeaderText="Number of  Likes" 
                SortExpression="CountOfID" />
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConnectionString="<%$ ConnectionStrings:Phones %>" 
        ProviderName="<%$ ConnectionStrings:Phones.ProviderName %>" 
        SelectCommand="SELECT [PhoneName], [CountOfID] FROM [CountLikes]">
    </asp:SqlDataSource>
    <br />
</asp:Content>
